/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-09-06
 * Time: 22:52
 */
public class test1 implements Runnable {
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(Thread.currentThread().getName() + " is running");
        }
    }

    public static void main(String[] args) {
        Thread thread1 = new Thread(new test1());
        Thread thread2 = new Thread(new test1());

        thread1.setPriority(Thread.MIN_PRIORITY); // 设置线程1的优先级为最低
        thread2.setPriority(Thread.MAX_PRIORITY); // 设置线程2的优先级为最高

        thread1.start();
        thread2.start();
    }
}
